package com.ruoyi.project.yuwen.topmanlog.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.yuwen.topmanlog.domain.AudioTopmanLog;
import com.ruoyi.project.yuwen.topmanlog.mapper.AudioTopmanLogMapper;
import com.ruoyi.project.yuwen.topmanlog.service.IAudioTopmanLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 达人日志Service业务层处理
 *
 * @author shixiangwen
 * @date 2021-03-19
 */
@Service
@DataSource(DataSourceType.KKCUSER)
public class AudioTopmanLogServiceImpl implements IAudioTopmanLogService {

    @Autowired
    private AudioTopmanLogMapper audioTopmanLogMapper;

    /**
     * 查询达人日志
     *
     * @param id 达人日志ID
     * @return 达人日志
     */
    @Override
    public AudioTopmanLog selectAudioTopmanLogById(Long id) {
        return audioTopmanLogMapper.selectAudioTopmanLogById(id);
    }

    /**
     * 查询达人日志列表
     *
     * @param audioTopmanLog 达人日志
     * @return 达人日志
     */
    @Override
    public List<AudioTopmanLog> selectAudioTopmanLogList(AudioTopmanLog audioTopmanLog) {
        return audioTopmanLogMapper.selectAudioTopmanLogList(audioTopmanLog);
    }

    /**
     * 新增达人日志
     *
     * @param audioTopmanLog 达人日志
     * @return 结果
     */
    @Override
    public int insertAudioTopmanLog(AudioTopmanLog audioTopmanLog) {
        return audioTopmanLogMapper.insertAudioTopmanLog(audioTopmanLog);
    }

    /**
     * 修改达人日志
     *
     * @param audioTopmanLog 达人日志
     * @return 结果
     */
    @Override
    public int updateAudioTopmanLog(AudioTopmanLog audioTopmanLog) {
        return audioTopmanLogMapper.updateAudioTopmanLog(audioTopmanLog);
    }

    /**
     * 删除达人日志对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAudioTopmanLogByIds(String ids) {
        return audioTopmanLogMapper.deleteAudioTopmanLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除达人日志信息
     *
     * @param id 达人日志ID
     * @return 结果
     */
    @Override
    public int deleteAudioTopmanLogById(Long id) {
        return audioTopmanLogMapper.deleteAudioTopmanLogById(id);
    }
}
